<?php
include 'dbcon.php';
$ename=$_REQUEST['e_name'];
$sql="insert into tb_emp(e_name) values('{$ename}')";
$rs=$db->query($sql);
if ($rs==true)
{
    echo "<script language='javascript' type='text/javascript'>";
    echo "alert('添加员工成功！');";
    echo "window.location.href='index.php'";
    echo "</script>";
} 
else
{
    echo "<script language='javascript' type='text/javascript'>";
    echo "alert('添加员工失败！');";
    echo "window.location.href='index.php'";
    echo "</script>";
}